package cn.iocoder.yudao.module.member.controller.app.user.vo;

import com.alibaba.excel.annotation.format.DateTimeFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.*;
import java.util.Date;

/**
 * @author chuhaifeng
 * @date 2025/4/19  22:05
 * @program ruoyi-vue-pro
 * @description 签证申请表基本信息数据传输对象
 *  所有字段均为必填项
 **/
@Data
@Schema(description = "用户 APP - 提交订单 填写办理签证基本信息")
public class PersonnelInfoBaseVO {

    @NotNull(message = "订单id不能为空")
    @Schema(description = "订单id", requiredMode = Schema.RequiredMode.REQUIRED, example = "12345")
    private Long tradeOrderId;

    @NotNull(message = "全名不能为空")
    @Schema(description = "全名", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
    private String fullName;

    /**
     * 曾用名（如无请填写"无"）
     */
    @Schema(description = "曾用名（如无请填写\"无\"）", example = "无")
    private String formerName;

    /**
     * 性别（MALE-男, FEMALE-女）
     */
    @NotBlank(message = "性别不能为空")
    @Pattern(regexp = "^(男|女)$", message = "性别必须为男或女")
    @Schema(description = "性别（MALE-男, FEMALE-女）", requiredMode = Schema.RequiredMode.REQUIRED, example = "男")
    private String gender;

    /**
     * 出生日期（格式：yyyy-MM-dd）
     */
    @NotNull(message = "出生日期不能为空")
    @DateTimeFormat("yyyy-MM-dd")
    @Past(message = "出生日期必须是过去的时间")
    @Schema(description = "出生日期（格式：yyyy-MM-dd）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1990-01-01")
    private Date birthDate;

    /**
     * 出生城市
     */
    @NotBlank(message = "出生城市不能为空")
    @Size(max = 100, message = "出生城市长度不能超过100个字符")
    @Schema(description = "出生城市", requiredMode = Schema.RequiredMode.REQUIRED, example = "北京")
    private String birthCity;

    /**
     * 身份证号码（18位）
     */
    @NotBlank(message = "身份证号码不能为空")
    @Size(min = 18, max = 18, message = "身份证号码必须为18位")
    @Schema(description = "身份证号码（18位）", requiredMode = Schema.RequiredMode.REQUIRED, example = "11010519900101001X")
    private String idNumber;

    /**
     * 配偶职业/父母职业
     */
    @NotBlank(message = "配偶职业/父母职业不能为空")
    @Schema(description = "配偶职业/父母职业", requiredMode = Schema.RequiredMode.REQUIRED, example = "医生")
    private String otherWork;

    /**
     * 婚姻状况（SINGLE-未婚, MARRIED-已婚, DIVORCED-离异, WIDOWED-丧偶）
     */
    @NotBlank(message = "婚姻状况不能为空")
    @Pattern(regexp = "^(未婚|已婚|离异|丧偶)$", message = "婚姻状况必须为未婚、已婚、离异或丧偶")
    @Schema(description = "婚姻状况（未婚, 已婚, 离异, 丧偶）", requiredMode = Schema.RequiredMode.REQUIRED, example = "已婚")
    private String maritalStatus;

    /**
     * 护照号码
     */
    @NotBlank(message = "护照号码不能为空")
    @Size(min = 8, max = 20, message = "护照号码长度必须在8到20个字符之间")
    @Schema(description = "护照号码", requiredMode = Schema.RequiredMode.REQUIRED, example = "G12345678")
    private String passportNumber;

    /**
     * 手机号
     */
    @NotBlank(message = "手机号不能为空")
    @Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "18311121111")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号码格式不正确")
    private String phoneNumber;

    /**
     * 护照签发地点
     */
    @NotBlank(message = "护照签发地点不能为空")
    @Size(max = 100, message = "护照签发地点长度不能超过100个字符")
    @Schema(description = "护照签发地点", requiredMode = Schema.RequiredMode.REQUIRED, example = "北京市公安局出入境管理局")
    private String passportIssuePlace;

    /**
     * 护照签发机关
     */
    @NotBlank(message = "护照签发机关不能为空")
    @Size(max = 100, message = "护照签发机关长度不能超过100个字符")
    @Schema(description = "护照签发机关", requiredMode = Schema.RequiredMode.REQUIRED, example = "北京市公安局出入境管理局")
    private String passportAuthority;

    /**
     * 护照签发日期（格式：yyyy-MM-dd）
     */
    @NotNull(message = "护照签发日期不能为空")
    @DateTimeFormat("yyyy-MM-dd")
    @PastOrPresent(message = "护照签发日期必须是过去或当前时间")
    @Schema(description = "护照签发日期（格式：yyyy-MM-dd）", requiredMode = Schema.RequiredMode.REQUIRED, example = "2020-01-01")
    private Date passportIssueDate;

    /**
     * 护照有效期至（格式：yyyy-MM-dd）
     */
    @NotNull(message = "护照有效期不能为空")
    @DateTimeFormat("yyyy-MM-dd")
    @Future(message = "护照有效期必须是未来时间")
    @Schema(description = "护照有效期至（格式：yyyy-MM-dd）", requiredMode = Schema.RequiredMode.REQUIRED, example = "2030-01-01")
    private Date passportExpiryDate;

    /**
     * 预计往返时间及航班
     */
    @Schema(description = "预计往返时间及航班", example = "2023-10-01 至 2023-10-10，航班号：CA123")
    private String travelPlan;

    /**
     * 上次时间及停留天数
     */
    @Schema(description = "上次时间及停留天数", example = "2022-05-01 至 2022-05-05，停留5天")
    private String lastTravelPlan;

    /**
     * 详细地址（街道门牌号）
     */
    @NotBlank(message = "详细地址不能为空")
    @Size(max = 200, message = "详细地址长度不能超过200个字符")
    @Schema(description = "详细地址（街道门牌号）", requiredMode = Schema.RequiredMode.REQUIRED, example = "北京市朝阳区某某路123号")
    private String detailedAddress;

    /**
     * 电子邮箱
     */
    @NotBlank(message = "电子邮箱不能为空")
    @Email(message = "电子邮箱格式不正确")
    @Size(max = 100, message = "电子邮箱长度不能超过100个字符")
    @Schema(description = "电子邮箱", requiredMode = Schema.RequiredMode.REQUIRED, example = "zhangsan@example.com")
    private String email;

    /**
     * 职业状况
     */
    @NotBlank(message = "职业状况不能为空")
    @Pattern(regexp = "^(在职|无业|学生|退休|其他)$", message = "职业状况必须为在职、无业、学生、退休或其他")
    @Schema(description = "职业状况（在职|无业|学生|退休|其他）", requiredMode = Schema.RequiredMode.REQUIRED, example = "在职")
    private String occupationStatus;

    /**
     * 工作单位名称
     */
    @Schema(description = "工作单位名称", example = "某某科技有限公司")
    private String workUnitName;

    /**
     * 工作单位地点
     */
    @Schema(description = "工作单位地点", example = "北京市海淀区某某路123号")
    private String workUnitPlace;

    /**
     * 工作单位电话
     */
    @Schema(description = "工作单位电话", example = "010-87654321")
    private String workUnitPhone;

    /**
     * 职位
     */
    @Schema(description = "职位", example = "软件工程师")
    private String position;
}
